<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

  <style>
    body>div{
      width: 300px;
        padding: 10px;
     background: rgba(0,0,0,.3);
        position: relative;
    }
    input{
        width: 180px;
        border: none;
        padding: 10px 20px;
    }
    img{
      position: absolute;
      left: 180px;
      top: 14px;
    }
    p{
      font-size: 12px;
      color: red;
      margin: 0;
    }
  </style>
</head>
<body>
<div>
  <input type="text"  placeholder=" 请输入用户名">
  <img src="img.png">
  <p> 用户名不能为空</p>



</div>


</body>
</html>